/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package battleshipgame.logic;
import battleshipgame.logic.Board ;
/**
 *
 * @author אלירן
 */
public class  MarkMatrix  {
    boolean mat [] [] ;
    public MarkMatrix() {
        mat = new boolean [Constants.BOARD_SIZE] [Constants.BOARD_SIZE];
        for ( int i = 0 ; i < Constants.BOARD_SIZE ; i ++)
                    for ( int k = 0 ; k < Constants.BOARD_SIZE ; k ++)
                        mat [i][k] = false;
    }
    public boolean  IsMarked (String coordinateString) throws InvalidInputException   { //For Printing purposes
        Coordinate coordinate ;
        coordinate = Coordinate.ConvertStringToXY(coordinateString) ;
        return (mat [coordinate.getX()][coordinate.getY()]) ;
    }
    public void Mark (String coordinateString) throws InvalidInputException{
        Coordinate coordinate;
        coordinate = Coordinate.ConvertStringToXY(coordinateString) ;
        mat [coordinate.getX()][coordinate.getY()] = !mat [coordinate.getX()][coordinate.getY()] ;
    }
}
